package reflect;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        //获取Person类中的doSome方法的注解@AutoRunMethod上的参数
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getDeclaredMethod("doSome");
        //判断该方法是否被@AutoRunMethod注解
        AutoRunMethod arm = method.getAnnotation(AutoRunMethod.class);
        int value = arm.value();//获取参数value
        System.out.println(value);

    }
}
